export function createGlobalWatermark(text = '机密文件') {
    const canvas = document.createElement('canvas')
    canvas.width = 300
    canvas.height = 200
    const ctx = canvas.getContext('2d')

    // 水印样式配置
    ctx.rotate(-20 * Math.PI / 180)
    ctx.font = '18px Arial'
    ctx.fillStyle = 'rgba(19,18,18,0.15)'
    ctx.textAlign = 'center'
    ctx.fillText(text, canvas.width/2, canvas.height/2)

    // 创建全屏覆盖层
    const watermarkDiv = document.createElement('div')
    watermarkDiv.id = 'global-watermark'
    watermarkDiv.style.cssText = `
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    background: url(${canvas.toDataURL()}) repeat;
    opacity: 0.5;
  `
    document.body.appendChild(watermarkDiv)
}